package com.omg.persistence.delegate.lifepoint;

import java.util.List;

import com.ibatis.dao.client.DaoManager;
import com.omg.persistence.dao.lifepoint.DaoConfig;
import com.omg.persistence.dao.lifepoint.entity.LPActivity;
import com.omg.persistence.dao.lifepoint.iface.LPActivityDao;

public class LPActivityDelegate {

	private static volatile LPActivityDelegate instance;
	private LPActivityDao lpActivityDao;
	private static final Object synObj = new Object();

	public static LPActivityDelegate getInstance() {
		if (instance == null) {
			instance = new LPActivityDelegate();
		}
		return instance;
	}

	private LPActivityDelegate() {
		synchronized (synObj) {
			DaoManager daoMgr = DaoConfig.getDaoManager();
			this.lpActivityDao = (LPActivityDao) daoMgr
					.getDao(LPActivityDao.class);
		}
	}

	public LPActivity getActivityByActivityId(String activityid) {
		return this.lpActivityDao.getActivityByActivityId(activityid);
	}

	public List<LPActivity> getFeedsByUserid(String userid) {
		return this.lpActivityDao.getFeedsByUserid(userid);
	}

	public int addLPActivity(LPActivity activity) {
		return this.lpActivityDao.addLPActivity(activity);
	}

	public int delLPActivity(String activityid) {
		return this.lpActivityDao.delLPActivity(activityid);
	}

	public int updateLPActivity(LPActivity activity) {
		return this.lpActivityDao.updateLPActivity(activity);
	}

}
